home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / AIAT 1.0.1 / Headers / Corpus / HFSTextFolderCorpus.h < prev    next >
Encoding:
Text File  |  1997-09-11  |  2.0 KB  |  76 lines  |  [TEXT/CWIE]

  1. // HFSTextFolderCorpus.h
  2. //    Copyright:    © 1994 - 1996 by Apple Computer, Inc., all rights reserved.
  3.  
  4. // A corpus implementation for all the text files under a root HFS folder.
  5.  
  6. #pragma once
  7. #ifndef HFSTextFolderCorpus_h
  8. #define HFSTextFolderCorpus_h
  9.  
  10. #pragma import on
  11.  
  12. #include "HFSCorpus.h"
  13.  
  14. #pragma IA_BEGIN_EXPORTS
  15.  
  16. const uint32    HFSFolderCorpusType = 'HTF1';
  17.  
  18. class HFSTextFolderCorpus : public HFSCorpus {
  19. public:    
  20.                 HFSTextFolderCorpus(uint32 type = HFSFolderCorpusType);
  21.                 HFSTextFolderCorpus(short vRef, long rootDirID, uint32 type = HFSFolderCorpusType);
  22.                 HFSTextFolderCorpus(StringPtr rootDirPath, uint32 type = HFSFolderCorpusType);
  23.  
  24.     // IACorpus methods
  25.     IADoc*        GetProtoDoc();
  26.     IADocIterator* GetDocIterator();
  27.     
  28.     void SetVolumeRefNum (short vrn) {    vRefNum = vrn;}
  29.     short GetVolumeRefNum () const {return vRefNum;}
  30.     
  31.     void SetRootDirID(long rootdirid) {rootDirId = rootdirid;}
  32.     long GetRootDirID() const {return rootDirId;}
  33.      
  34. protected:
  35.     IABlockSize    InitialSize();
  36.     void        Initializing(IAOutputBlock* output);
  37.     void        Opening(IAInputBlock* input);
  38.     IABlockSize    UpdateSize();
  39.     void        Updating(IAOutputBlock* output);
  40. private:
  41.                 HFSTextFolderCorpus(HFSTextFolderCorpus& fc);
  42.     short        vRefNum;
  43.     long        rootDirId;
  44.  
  45. };
  46.  
  47. class HFSTextFolderDoc : public HFSDoc {
  48. public:
  49.                 HFSTextFolderDoc(HFSTextFolderCorpus* corpus, long dirID, const StringPtr name, long date);
  50.                 HFSTextFolderDoc() : HFSDoc() {}
  51.  
  52.     IAStorable*    DeepCopy() const;
  53.     IABlockSize    StoreSize() const;
  54.     void        Store(IAOutputBlock* output) const;
  55.     IAStorable*    Restore(IAInputBlock* input) const;
  56.  
  57.     bool        LessThan(const IAOrderedStorable* neighbor) const;
  58.     bool        Equal(const IAOrderedStorable* neighbor) const;
  59.     
  60.     void    SetModDate (long mDate) {modDate = mDate;}
  61.     long    GetModDate () const {return modDate;}
  62.  
  63. protected:
  64.     void        DeepCopying(const IAStorable* source);
  65.     void        Restoring(IAInputBlock* input, const IAStorable* proto);
  66. private:
  67.                 HFSTextFolderDoc(HFSDoc& fd);
  68.     long        modDate;
  69. };
  70.  
  71. #pragma IA_END_EXPORTS
  72.  
  73. #pragma import reset
  74.  
  75. #endif
  76.